-- @owner: @zou_jialiang050
-- @date: 2022/09/15
-- @testpoint: show create trigger查询触发条件为before触发器

--step1:建表及触发器;expect:成功
drop table if exists t_show_create_trigger_0007;
create table t_show_create_trigger_0007(c1 int);
create or replace function f_show_create_trigger_0007() returns trigger
as $$
    declare
    begin
           delete from t_show_create_trigger_0007;
           return new;
    end
$$ language plpgsql;
/

drop trigger if exists tri_show_create_trigger_0007 on t_show_create_trigger_0007;
create trigger tri_show_create_trigger_0007
          before delete on t_show_create_trigger_0007
          for each row
          execute procedure f_show_create_trigger_0007();
/

--step2:show create trigger查询触发条件为before触发器;expect:成功
show create trigger tri_show_create_trigger_0007;

--step3:清理环境;expect:成功
drop trigger if exists tri_show_create_trigger_0007 on t_show_create_trigger_0007;
drop table if exists t_show_create_trigger_0007 cascade;
drop function if exists f_show_create_trigger_0007;
